package com.ineatconseil.yougo.bo;

import java.util.Date;

import org.springframework.data.document.mongodb.mapping.DBRef;
import org.springframework.data.document.mongodb.mapping.Document;

/**
 * This business object represents a request for holidays.
 * This object holds many 
 * @author David BRASSELY
 * @author Hubert SABLONNIERE
 *
 */
@Document
public class Request extends BaseEntity {

	private static final long serialVersionUID = -1374967354851164891L;

	/**
	 * Start date for the request
	 */
	private Date from;

	/**
	 * End date for the request
	 */
	private Date to;

	/**
	 * A comment about the request
	 */
	private String askComment;

	/**
	 * The answer of the user who change the status of the request
	 */
	private String answerComment;

	/**
	 * The type of the request.
	 */
	@DBRef
	private RequestType type;
	
	/**
	 * The request's status
	 */
	@DBRef
	private RequestStatus status = RequestStatus.PENDING;
	
	@DBRef
	private User user;

	public Date getFrom() {
		return from;
	}

	public void setFrom(Date from) {
		this.from = from;
	}

	public Date getTo() {
		return to;
	}

	public void setTo(Date to) {
		this.to = to;
	}

	public String getAskComment() {
		return askComment;
	}

	public void setAskComment(String askComment) {
		this.askComment = askComment;
	}

	public String getAnswerComment() {
		return answerComment;
	}

	public void setAnswerComment(String answerComment) {
		this.answerComment = answerComment;
	}

	public RequestType getType() {
		return type;
	}

	public void setType(RequestType type) {
		this.type = type;
	}

	public RequestStatus getStatus() {
		return status;
	}

	public void setStatus(RequestStatus status) {
		this.status = status;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}
